var _page = $('.page')
// 加载最新单身列表
var thisload1 = bottlecms.load({
    elem: $('.infinite-team1'),
    scroll: $('.infinite-scroll1'),
    done: function(page, next) {
        var src = this.elem.attr("pages-src");
        bottlecms.get(src, {
            page: page
        }, function(data) {
            var lis = [];
            for (var o in data.list) {
                lis.push(userlist_template(data.list[o]))
            }
            next(lis.join(''), lis.length);
        })
    }
})
var thisload2 = bottlecms.load({
    elem: $('.infinite-team2'),
    scroll: $('.infinite-scroll2'),
    done: function(page, next) {
        var src = this.elem.attr("pages-src");
        bottlecms.get(src, {
            page: page
        }, function(data) {
            var lis = [];
            for (var o in data.list) {
                lis.push(userlist_template(data.list[o]))
            }
            next(lis.join(''), lis.length);
        })
    }
})
var thisload3 = bottlecms.load({
    elem: $('.infinite-team3'),
    scroll: $('.infinite-scroll3'),
    done: function(page, next) {
        var src = this.elem.attr("pages-src");
        bottlecms.get(src, {
            page: page
        }, function(data) {
            var lis = [];
            for (var o in data.list) {
                lis.push(userlist_template(data.list[o]))
            }
            next(lis.join(''), lis.length);
        })
    }
})



thisload1.load();

$(_page).on('click', '.bcui-tab .bcui-tab-title .item', function(event) {
    setTimeout(function() {
        if($('.bcui-tab .bcui-tab-content .item.active .infinite-team1').length>0){
            thisload1.load();
        }
        else if($('.bcui-tab .bcui-tab-content .item.active .infinite-team2').length>0){
            thisload2.load();
        }
        else if($('.bcui-tab .bcui-tab-content .item.active .infinite-team3').length>0){
            thisload3.load();
        }
    }, 100)
});